package com.baizhi.service;

import com.baizhi.dao.CategoryDao;
import com.baizhi.entity.Category;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author liukaixuan
 */
@Service("categoryService")
public class CategoryServiceImpl implements CategoryService{

    @Resource
    private CategoryDao categoryDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public Category queryById(Integer id) {
        return this.categoryDao.queryById(id);
    }

    @Override
    public List<Category> findAll() {
        List<Category> categories = this.categoryDao.findAll();
        return categories;
    }
}
